package AbstractTransaction

import (
	"salary_payment_case/DataBase"
	"salary_payment_case/Model"
	//"salary_payment_case/ModelImplementation"
)

type AddEmployeeTransaction struct {
	Classification
	itsEmpid   int
	itsName    string
	itsAddress string
}

type Classification interface {
	GetClassification() Model.PaymentClassification
	GetSchedule() Model.PaymentSchedule
}

func (newem_ *AddEmployeeTransaction) Execute() {
	pc := newem_.GetClassification()
	ps := newem_.GetSchedule()
	//pm := newem_.HoldMethod{}
	e := Model.NewEmployee(newem_.itsEmpid, newem_.itsName, newem_.itsAddress)
	e.SetSchedule(ps)
	e.SetClassification(pc)
	//e.SetMethod(pm)
	DataBase.PayrollDatabase.AddEmployee(e.GetEmpid(), e)
}
